<template>
  <div class="content">
    <c-header></c-header>
    <div class="main">
        <nuxt />
    </div>
    <el-backtop></el-backtop>
    <u-sign v-if="signVisible" @click.self="loginState = !loginState"></u-sign>
  </div>
</template>

<script>
import { mapMutations, mapGetters, mapActions} from 'vuex';
import { clone } from '../utils/index'
import cHeader from '../components/layout/hearder'
import cFooter from '../components/layout/footer'
import uSign from '../components/signModel'

export default {
  data() {
    return {
    };
  },
  computed: {
    ...mapGetters(['signVisible', 'currentRouter'])
  },
  methods: {
    ...mapMutations({
      setCurrentRouter: 'SET_CURRENT_ROUTE'
    }),
    getCurrentRoute() {
      const {name, params, query} = this.$route
      this.setCurrentRouter({
        name,
        params,
        query
      })
    }
  },
  watch: {
    $route() {
      this.getCurrentRoute()
    }
  },
  components: {
    cHeader, cFooter, uSign
  },
  mounted() {
    this.getCurrentRoute()
  }
};
</script>

<style scoped>
.content {
  padding: 0 -5px;
  background-color: #f6f6f6;
}
.main {
  width: 100%;
  max-width: 1000px;
  height: auto;
  min-height: 710px;
  padding-top: 10px;
  margin: 0px auto;
  background-color: #f6f6f6;
}
</style>
